@extends('admin.app')

@section('breadcrumb')
  <div class="bg-light lter b-b wrapper-md">
    <ol class="breadcrumb bg-light lter m-n no-padder">
      <li><a href="{{admin_action('HomeController@index')}}"> 主页</a></li>
      <li><a href="{{admin_action('Web\ArticleCategoriesController@index')}}">文章分类</a></li>
      <li class="active">新增文章分类</li>
    </ol>
  </div>
@endsection

@section('content')
  <div class="panel panel-default">
    <div class="panel-heading font-bold">
      文章分类信息表单
    </div>
    <div class="panel-body">
      <form class="form-horizontal form-validation" action="{{ admin_action('Web\ArticleCategoriesController@store') }}" method="post">
        {{ csrf_field() }}
        <div class="form-group">
          <label class="col-lg-2 control-label">名称*</label>
          <div class="col-lg-10">
            <input type="text" class="form-control" name="name" value="{{old('name')}}" placeholder="请输入文章分类名称"
                   data-rule-required="true" data-rule-maxlength="100">          </div>
        </div>
        <div class="line line-dashed b-b line-lg"></div>
        <div class="form-group">
          <label class="col-lg-2 control-label">父级文章分类*</label>
          <div class="col-lg-10">
            <select class="form-control select2" name="parent">
              <option value="">请选择父级文章分类</option>
              @foreach($article_category as $name=>$id)
                <option value="{{ $id }}">{{ $name }}</option>
              @endforeach
            </select>
          </div>
        </div>
        <div class="line line-dashed b-b line-lg"></div>
        <div class="form-group">
          <label class="col-lg-2 control-label">显示*</label>
          <div class="col-lg-10">
            <label class="radio-inline i-checks i-checks-sm">
              <input type="radio" name="display" value="1" {{old('display')!=='0'?'checked':''}}>
              <i></i> 是
            </label>
            <label class="radio-inline i-checks i-checks-sm">
              <input type="radio" name="display" value="0" {{old('display')==='0'?'checked':''}}>
              <i></i> 否
            </label>
          </div>
        </div>
        <div class="form-group">
          <label class="col-lg-2 control-label">推荐*</label>
          <div class="col-lg-10">
            <label class="radio-inline i-checks i-checks-sm">
              <input type="radio" name="recommended" value="1" {{old('recommended')?'checked':''}}>
              <i></i> 是
            </label>
            <label class="radio-inline i-checks i-checks-sm">
              <input type="radio" name="recommended" value="0" {{old('recommended')?'':'checked'}}>
              <i></i> 否
            </label>
          </div>
        </div>
        <div class="form-group">
          <label class="col-lg-2 control-label">描述*</label>
          <div class="col-lg-10">
             <textarea class="form-control" rows="5" name="description" placeholder="请输入描述信息"
                       data-rule-maxlength="200">{{old('description')}}</textarea>
          </div>
        </div>
        <div class="form-group">
          <label class="col-lg-2 control-label">排序*</label>
          <div class="col-lg-10">
            <input type="text" class="form-control" name="sort" value="{{old('sort')??0}}" placeholder="请输入排序数字"
                   data-rule-required="true" data-rule-digits="true">
          </div>
        </div>
        <div class="line line-dashed b-b line-lg"></div>
        <div class="form-group">
          <div class="col-lg-4 col-lg-offset-2">
            <a href="{{ admin_action('Web\ArticleCategoriesController@index') }}" class="btn btn-default">返&nbsp;回</a>
            <button type="submit" class="btn btn-primary">保&nbsp;存</button>
          </div>
        </div>
      </form>
    </div>
  </div>
@endsection